package lanxing.future.base.chapter10;

/**
 * @author <a href="mailto:lanxing@chances.com.cn">lanxing</a>
 * @version 2019年7月26日
 *
 */
public class Parcel4 {
    private class PContents implements Contents {
        private int i = 11;

        public int value() {
            return i;
        }
    }
    
    protected class PDestination implements Destination{
        private String label;

        public PDestination(String label) {
            super();
            this.label = label;
        }
        
        public String readLabel() {
            return this.label;
        }
    }
    
    public Contents contents() {
        return new PContents();
    }
    
    public Destination destination(String label) {
        return new PDestination(label);
    }
    
    public static void main(String[] args) {
        Parcel4 p4 = new Parcel4();
        
        Contents contents = p4.contents();
        System.out.println(contents.value());
        
        Destination destination = p4.destination("lanxing");
        System.out.println(destination.readLabel());
    }
}
